/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controller;

import java.awt.Point;
import java.util.LinkedList;

/**
 *
 * @author asouza, subx
 */
public class Node {

    private int weight;
    private int id;
    private Graph graph;
    private Point position;

    
    public Node() {
    }

    public Node(int id, int weight, int x, int y, Graph grafo) {
        this.graph = grafo;
        this.id = id;
        this.weight = weight;
        this.position = new Point(x,y);
    }

    /**
     * Get the value of weight
     *
     * @return the value of weight
     */
    public int getWeight() {
        return weight;
    }

    /**
     * Set the value of weight
     *
     * @param weight new value of weight
     */
    public void setWeight(int weight) {
        this.weight = weight;
    }

    public Point getPosition() {
        return position;
    }

    public void setPosition(Point position) {
        this.position = position;
    }

    public Graph getGraph() {
        return graph;
    }

    public void setGraph(Graph graph) {
        this.graph = graph;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    /**
     * Encontra uma lista com os sucessores do nó atual.
     * @return lista com os sucessores do nó atual
     */

    public LinkedList<Node> getSucessors() {
        return graph.getSucessors(this.id);
    }

    

}
